import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  CreateDateColumn,
} from 'typeorm';
import { ApiProperty } from '@nestjs/swagger';

@Entity()
export class Comment {
  @ApiProperty({ description: '评论 ID', example: 1 })
  @PrimaryGeneratedColumn()
  id: number;

  @ApiProperty({ description: '评论内容', example: '这是一条评论' })
  @Column({ type: 'text' })
  content: string;

  @ApiProperty({ description: '用户 ID', example: 1 })
  @Column()
  userId: number;

  @ApiProperty({ description: '话题 ID', example: 1 })
  @Column()
  topicId: number;

  @ApiProperty({
    description: '评论创建时间',
    example: '2025-05-05T13:39:39.000Z',
  })
  @CreateDateColumn()
  createdAt: Date;
}
